Prereq: "4.0p2"
*** ../tk4.0p2/patchlevel.h	Mon Sep 18 11:42:16 1995
--- patchlevel.h	Mon Nov 27 09:03:15 1995
***************
*** 17,23 ****
   * See the file "license.terms" for information on usage and redistribution
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   *
!  * @(#) patchlevel.h 1.9 95/09/18 11:42:14
   */
  
! #define TK_PATCH_LEVEL "4.0p2"
--- 17,23 ----
   * See the file "license.terms" for information on usage and redistribution
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   *
!  * @(#) patchlevel.h 1.10 95/11/27 09:03:19
   */
  
! #define TK_PATCH_LEVEL "4.0p3"
*** ../tk4.0p2/./Makefile.in	Mon Sep 18 13:28:27 1995
--- ./Makefile.in	Mon Nov 27 13:22:35 1995
***************
*** 5,11 ****
  # "autoconf" program (constructs like "@foo@" will get replaced in the
  # actual Makefile.
  #
! # @(#) Makefile.in 1.39 95/06/30 11:18:46
  
  # Current Tk version;  used in various names.
  
--- 5,11 ----
  # "autoconf" program (constructs like "@foo@" will get replaced in the
  # actual Makefile.
  #
! # @(#) Makefile.in 1.41 95/11/19 16:15:24
  
  # Current Tk version;  used in various names.
  
*** ../tk4.0p2/./tkBind.c	Sun Jun  4 17:37:04 1995
--- ./tkBind.c	Mon Sep 25 13:19:01 1995
***************
*** 11,17 ****
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkBind.c 1.98 95/06/04 17:37:03";
  
  #include "tkPort.h"
  #include "tkInt.h"
--- 11,17 ----
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkBind.c 1.100 95/09/25 13:18:59";
  
  #include "tkPort.h"
  #include "tkInt.h"
*** ../tk4.0p2/./tkColor.c	Sat Mar 18 15:43:46 1995
--- ./tkColor.c	Tue Sep 26 17:11:24 1995
***************
*** 12,18 ****
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkColor.c 1.36 95/03/18 15:43:38";
  
  #include "tkPort.h"
  #include "tk.h"
--- 12,18 ----
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkColor.c 1.37 95/09/26 17:11:23";
  
  #include "tkPort.h"
  #include "tk.h"
***************
*** 547,556 ****
  {
      TkStressedCmap *stressPtr;
      float tmp, distance, closestDistance;
!     int i, closest;
      XColor *colorPtr;
      TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
      Colormap colormap = Tk_Colormap(tkwin);
  
      /*
       * Find the TkStressedCmap structure for this colormap, or create
--- 547,557 ----
  {
      TkStressedCmap *stressPtr;
      float tmp, distance, closestDistance;
!     int i, closest, numFound;
      XColor *colorPtr;
      TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
      Colormap colormap = Tk_Colormap(tkwin);
+     XVisualInfo template, *visInfoPtr;
  
      /*
       * Find the TkStressedCmap structure for this colormap, or create
***************
*** 561,567 ****
  	if (stressPtr == NULL) {
  	    stressPtr = (TkStressedCmap *) ckalloc(sizeof(TkStressedCmap));
  	    stressPtr->colormap = colormap;
! 	    stressPtr->numColors = 1<<Tk_Depth(tkwin);
  	    stressPtr->colorPtr = (XColor *) ckalloc((unsigned)
  		    (stressPtr->numColors * sizeof(XColor)));
  	    for (i = 0; i  < stressPtr->numColors; i++) {
--- 562,574 ----
  	if (stressPtr == NULL) {
  	    stressPtr = (TkStressedCmap *) ckalloc(sizeof(TkStressedCmap));
  	    stressPtr->colormap = colormap;
! 	    template.visualid = XVisualIDFromVisual(Tk_Visual(tkwin));
! 	    visInfoPtr = XGetVisualInfo(Tk_Display(tkwin),
! 		    VisualIDMask, &template, &numFound);
! 	    if (numFound != 1) {
! 		panic("FindClosestColor couldn't lookup visual");
! 	    }
! 	    stressPtr->numColors = visInfoPtr->colormap_size;
  	    stressPtr->colorPtr = (XColor *) ckalloc((unsigned)
  		    (stressPtr->numColors * sizeof(XColor)));
  	    for (i = 0; i  < stressPtr->numColors; i++) {
*** ../tk4.0p2/./tkMain.c	Thu Jun  8 11:43:05 1995
--- ./tkMain.c	Mon Sep 25 14:33:55 1995
***************
*** 14,20 ****
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkMain.c 1.114 95/06/08 11:43:00";
  
  #include <ctype.h>
  #include <stdio.h>
--- 14,20 ----
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkMain.c 1.115 95/09/25 14:33:57";
  
  #include <ctype.h>
  #include <stdio.h>
***************
*** 64,69 ****
--- 64,70 ----
  static char *name = NULL;
  static char *display = NULL;
  static char *geometry = NULL;
+ static int rest = 0;
  
  static Tk_ArgvInfo argTable[] = {
      {"-display", TK_ARGV_STRING, (char *) NULL, (char *) &display,
***************
*** 74,79 ****
--- 75,82 ----
  	"Name to use for application"},
      {"-sync", TK_ARGV_CONSTANT, (char *) 1, (char *) &synchronize,
  	"Use synchronous mode for display server"},
+     {"--", TK_ARGV_REST, (char *) 1, (char *) &rest,
+ 	"Pass all remaining arguments through to script"},
      {(char *) NULL, TK_ARGV_END, (char *) NULL, (char *) NULL,
  	(char *) NULL}
  };
*** ../tk4.0p2/./tkPack.c	Sun May 28 14:02:36 1995
--- ./tkPack.c	Fri Nov 24 17:52:10 1995
***************
*** 11,17 ****
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkPack.c 1.54 95/05/28 14:02:32";
  
  #include "tkPort.h"
  #include "tkInt.h"
--- 11,17 ----
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkPack.c 1.56 95/11/24 17:52:11";
  
  #include "tkPort.h"
  #include "tkInt.h"
***************
*** 770,776 ****
  		if (abort) {
  		    goto done;
  		}
! 		Tk_MapWindow(slavePtr->tkwin);
  	    }
  	} else {
  	    if ((width <= 0) || (height <= 0)) {
--- 770,784 ----
  		if (abort) {
  		    goto done;
  		}
! 
! 		/*
! 		 * Don't map the slave if the master isn't mapped: wait
! 		 * until the master gets mapped later.
! 		 */
! 
! 		if (Tk_IsMapped(masterPtr->tkwin)) {
! 		    Tk_MapWindow(slavePtr->tkwin);
! 		}
  	    }
  	} else {
  	    if ((width <= 0) || (height <= 0)) {
***************
*** 1351,1356 ****
--- 1359,1388 ----
  	}
  	packPtr->tkwin = NULL;
  	Tk_EventuallyFree((ClientData) packPtr, DestroyPacker);
+     } else if (eventPtr->type == MapNotify) {
+ 	/*
+ 	 * When a master gets mapped, must redo the geometry computation
+ 	 * so that all of its slaves get remapped.
+ 	 */
+ 
+ 	if ((packPtr->slavePtr != NULL)
+ 		&& !(packPtr->flags & REQUESTED_REPACK)) {
+ 	    packPtr->flags |= REQUESTED_REPACK;
+ 	    Tk_DoWhenIdle(ArrangePacking, (ClientData) packPtr);
+ 	}
+     } else if (eventPtr->type == UnmapNotify) {
+ 	Packer *packPtr2;
+ 
+ 	/*
+ 	 * Unmap all of the slaves when the master gets unmapped,
+ 	 * so that they don't bother to keep redisplaying
+ 	 * themselves.
+ 	 */
+ 
+ 	for (packPtr2 = packPtr->slavePtr; packPtr2 != NULL;
+ 		packPtr2 = packPtr2->nextPtr) {
+ 	    Tk_UnmapWindow(packPtr2->tkwin);
+ 	}
      }
  }
  
***************
*** 1629,1635 ****
  
  	/*
  	 * Make sure that the slave's parent is either the master or
! 	 * an ancestor of the master.
  	 */
      
  	parent = Tk_Parent(slave);
--- 1661,1668 ----
  
  	/*
  	 * Make sure that the slave's parent is either the master or
! 	 * an ancestor of the master, and that the master and slave
! 	 * aren't the same.
  	 */
      
  	parent = Tk_Parent(slave);
***************
*** 1643,1648 ****
--- 1676,1686 ----
  			(char *) NULL);
  		return TCL_ERROR;
  	    }
+ 	}
+ 	if (slave == masterPtr->tkwin) {
+ 	    Tcl_AppendResult(interp, "can't pack ", argv[j],
+ 		    " inside itself", (char *) NULL);
+ 	    return TCL_ERROR;
  	}
  
  	/*
*** ../tk4.0p2/./tkPlace.c	Sun Jun  4 14:23:52 1995
--- ./tkPlace.c	Mon Nov 27 09:25:57 1995
***************
*** 11,17 ****
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkPlace.c 1.21 95/06/04 14:23:50";
  
  #include "tkPort.h"
  #include "tkInt.h"
--- 11,17 ----
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "%Z% %M% %I% %E% %U%";
  
  #include "tkPort.h"
  #include "tkInt.h"
***************
*** 553,559 ****
  
  	    /*
  	     * Make sure that the new master is either the logical parent
! 	     * of the slave or a descendant of that window.
  	     */
  
  	    for (ancestor = tkwin; ; ancestor = Tk_Parent(ancestor)) {
--- 553,560 ----
  
  	    /*
  	     * Make sure that the new master is either the logical parent
! 	     * of the slave or a descendant of that window, and that the
! 	     * master and slave aren't the same.
  	     */
  
  	    for (ancestor = tkwin; ; ancestor = Tk_Parent(ancestor)) {
***************
*** 568,573 ****
--- 569,581 ----
  		    goto done;
  		}
  	    }
+ 	    if (slavePtr->tkwin == tkwin) {
+ 		Tcl_AppendResult(interp, "can't place ",
+ 			Tk_PathName(slavePtr->tkwin), " relative to itself",
+ 			(char *) NULL);
+ 		result = TCL_ERROR;
+ 		goto done;
+ 	    }
  	    if ((slavePtr->masterPtr != NULL)
  		    && (slavePtr->masterPtr->tkwin == tkwin)) {
  		/*
***************
*** 847,853 ****
  		    || (height != Tk_Height(slavePtr->tkwin))) {
  		Tk_MoveResizeWindow(slavePtr->tkwin, x, y, width, height);
  	    }
! 	    Tk_MapWindow(slavePtr->tkwin);
  	} else {
  	    if ((width <= 0) || (height <= 0)) {
  		Tk_UnmaintainGeometry(slavePtr->tkwin, masterPtr->tkwin);
--- 855,869 ----
  		    || (height != Tk_Height(slavePtr->tkwin))) {
  		Tk_MoveResizeWindow(slavePtr->tkwin, x, y, width, height);
  	    }
! 
! 	    /*
! 	     * Don't map the slave unless the master is mapped: the slave
! 	     * will get mapped later, when the master is mapped.
! 	     */
! 
! 	    if (Tk_IsMapped(masterPtr->tkwin)) {
! 		Tk_MapWindow(slavePtr->tkwin);
! 	    }
  	} else {
  	    if ((width <= 0) || (height <= 0)) {
  		Tk_UnmaintainGeometry(slavePtr->tkwin, masterPtr->tkwin);
***************
*** 907,912 ****
--- 923,949 ----
  	}
  	masterPtr->tkwin = NULL;
  	ckfree((char *) masterPtr);
+     } else if (eventPtr->type == MapNotify) {
+ 	/*
+ 	 * When a master gets mapped, must redo the geometry computation
+ 	 * so that all of its slaves get remapped.
+ 	 */
+ 
+ 	if ((masterPtr->slavePtr != NULL)
+ 		&& !(masterPtr->flags & PARENT_RECONFIG_PENDING)) {
+ 	    masterPtr->flags |= PARENT_RECONFIG_PENDING;
+ 	    Tk_DoWhenIdle(RecomputePlacement, (ClientData) masterPtr);
+ 	}
+     } else if (eventPtr->type == UnmapNotify) {
+ 	/*
+ 	 * Unmap all of the slaves when the master gets unmapped,
+ 	 * so that they don't keep redisplaying themselves.
+ 	 */
+ 
+ 	for (slavePtr = masterPtr->slavePtr; slavePtr != NULL;
+ 		slavePtr = slavePtr->nextPtr) {
+ 	    Tk_UnmapWindow(slavePtr->tkwin);
+ 	}
      }
  }
  
*** ../tk4.0p2/./tkSend.c	Mon Aug 21 10:49:15 1995
--- ./tkSend.c	Thu Nov  9 10:29:11 1995
***************
*** 12,18 ****
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkSend.c 1.50 95/08/21 10:49:10";
  
  #include "tkPort.h"
  #include "tkInt.h"
--- 12,18 ----
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkSend.c 1.51 95/11/09 10:29:13";
  
  #include "tkPort.h"
  #include "tkInt.h"
***************
*** 1219,1226 ****
  				 * interpreter is needed anyway). */
      TkDisplay *dispPtr;		/* Display to initialize. */
  {
-     TkMainInfo *mainPtr;
-     TkWindow *winPtr;
      XSetWindowAttributes atts;
  
      /*
--- 1219,1224 ----
***************
*** 1241,1268 ****
      Tk_MakeWindowExist(dispPtr->commTkwin);
  
      /*
-      * Find a window on the display to use for registering property
-      * names.
-      */
- 
-     for (mainPtr = tkMainWindowList; ; mainPtr = mainPtr->nextPtr) {
- 	if (mainPtr == NULL) {
- 	    return TCL_OK;
- 	}
- 	if (mainPtr->winPtr->dispPtr == dispPtr) {
- 	    winPtr = mainPtr->winPtr;
- 	    break;
- 	}
-     }
- 
-     /*
       * Get atoms used as property names.
       */
  
!     dispPtr->commProperty = Tk_InternAtom((Tk_Window) winPtr, "Comm");
!     dispPtr->registryProperty = Tk_InternAtom((Tk_Window) winPtr,
  	    "InterpRegistry");
!     dispPtr->appNameProperty = Tk_InternAtom((Tk_Window) winPtr,
  	    "TK_APPLICATION");
  
      return TCL_OK;
--- 1239,1251 ----
      Tk_MakeWindowExist(dispPtr->commTkwin);
  
      /*
       * Get atoms used as property names.
       */
  
!     dispPtr->commProperty = Tk_InternAtom(dispPtr->commTkwin, "Comm");
!     dispPtr->registryProperty = Tk_InternAtom(dispPtr->commTkwin,
  	    "InterpRegistry");
!     dispPtr->appNameProperty = Tk_InternAtom(dispPtr->commTkwin,
  	    "TK_APPLICATION");
  
      return TCL_OK;
*** ../tk4.0p2/./tkVisual.c	Wed Aug 16 10:43:49 1995
--- ./tkVisual.c	Sun Oct  1 16:35:39 1995
***************
*** 12,18 ****
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkVisual.c 1.13 95/08/16 10:43:48";
  
  #include "tkInt.h"
  #include "tkPort.h"
--- 12,18 ----
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkVisual.c 1.14 95/10/01 16:35:38";
  
  #include "tkInt.h"
  #include "tkPort.h"
***************
*** 313,319 ****
  	    cmapPtr->colormap = XCreateColormap(Tk_Display(tkwin),
  		    RootWindowOfScreen(Tk_Screen(tkwin)), visual,
  		    AllocNone);
! 	    cmapPtr->visual = NULL;
  	    cmapPtr->refCount = 1;
  	    cmapPtr->shareable = 1;
  	    cmapPtr->nextPtr = dispPtr->cmapPtr;
--- 313,319 ----
  	    cmapPtr->colormap = XCreateColormap(Tk_Display(tkwin),
  		    RootWindowOfScreen(Tk_Screen(tkwin)), visual,
  		    AllocNone);
! 	    cmapPtr->visual = visual;
  	    cmapPtr->refCount = 1;
  	    cmapPtr->shareable = 1;
  	    cmapPtr->nextPtr = dispPtr->cmapPtr;
*** ../tk4.0p2/./tkWindow.c	Wed Jun  7 13:13:22 1995
--- ./tkWindow.c	Mon Sep 25 13:19:01 1995
***************
*** 13,19 ****
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkWindow.c 1.185 95/06/07 13:13:20";
  
  #include "tkPort.h"
  #include "tkInt.h"
--- 13,19 ----
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkWindow.c 1.187 95/09/25 13:18:57";
  
  #include "tkPort.h"
  #include "tkInt.h"
*** ../tk4.0p2/./tkWm.c	Mon Aug 21 10:49:16 1995
--- ./tkWm.c	Mon Nov 27 13:02:34 1995
***************
*** 13,19 ****
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkWm.c 1.108 95/08/21 10:49:12";
  
  #include "tkPort.h"
  #include "tkInt.h"
--- 13,19 ----
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkWm.c 1.111 95/11/27 13:02:37";
  
  #include "tkPort.h"
  #include "tkInt.h"
***************
*** 277,282 ****
--- 277,284 ----
  static int		ComputeReparentGeometry _ANSI_ARGS_((TkWindow *winPtr));
  static void		ConfigureEvent _ANSI_ARGS_((TkWindow *winPtr,
  			    XConfigureEvent *eventPtr));
+ static void		GetMaxSize _ANSI_ARGS_((WmInfo *wmPtr,
+ 			    int *maxWidthPtr, int *maxHeightPtr));
  static int		ParseGeometry _ANSI_ARGS_((Tcl_Interp *interp,
  			    char *string, TkWindow *winPtr));
  static void		ReparentEvent _ANSI_ARGS_((TkWindow *winPtr,
***************
*** 349,356 ****
       * a guess about how space is needed for window manager decorations.
       */
  
!     wmPtr->maxWidth = DisplayWidth(winPtr->display, winPtr->screenNum) - 15;
!     wmPtr->maxHeight = DisplayHeight(winPtr->display, winPtr->screenNum) - 30;
      wmPtr->gridWin = NULL;
      wmPtr->widthInc = wmPtr->heightInc = 1;
      wmPtr->minAspect.x = wmPtr->minAspect.y = 1;
--- 351,358 ----
       * a guess about how space is needed for window manager decorations.
       */
  
!     wmPtr->maxWidth = 0;
!     wmPtr->maxHeight = 0;
      wmPtr->gridWin = NULL;
      wmPtr->widthInc = wmPtr->heightInc = 1;
      wmPtr->minAspect.x = wmPtr->minAspect.y = 1;
***************
*** 1348,1355 ****
  	    return TCL_ERROR;
  	}
  	if (argc == 3) {
! 	    sprintf(interp->result, "%d %d", wmPtr->maxWidth,
! 		    wmPtr->maxHeight);
  	    return TCL_OK;
  	}
  	if ((Tcl_GetInt(interp, argv[3], &width) != TCL_OK)
--- 1350,1357 ----
  	    return TCL_ERROR;
  	}
  	if (argc == 3) {
! 	    GetMaxSize(wmPtr, &width, &height);
! 	    sprintf(interp->result, "%d %d", width, height);
  	    return TCL_OK;
  	}
  	if ((Tcl_GetInt(interp, argv[3], &width) != TCL_OK)
***************
*** 1766,1775 ****
       * in pixel units and there's no easy way to translate them to
       * grid units since the new requested size of the top-level window in
       * pixels may not yet have been registered yet (it may filter up
!      * the hierarchy in DoWhenIdle handlers).
       */
  
!     if (wmPtr->gridWin == NULL) {
  	wmPtr->width = -1;
  	wmPtr->height = -1;
      }
--- 1768,1780 ----
       * in pixel units and there's no easy way to translate them to
       * grid units since the new requested size of the top-level window in
       * pixels may not yet have been registered yet (it may filter up
!      * the hierarchy in DoWhenIdle handlers).  However, if the window
!      * has never been mapped yet then just leave the window size alone:
!      * assume that it is intended to be in grid units but just happened
!      * to have been specified before this procedure was called.
       */
  
!     if ((wmPtr->gridWin == NULL) && !(wmPtr->flags & WM_NEVER_MAPPED)) {
  	wmPtr->width = -1;
  	wmPtr->height = -1;
      }
***************
*** 2494,2499 ****
--- 2499,2505 ----
  {
      register WmInfo *wmPtr = winPtr->wmInfoPtr;
      XSizeHints *hintsPtr;
+     int maxWidth, maxHeight;
  
      wmPtr->flags &= ~WM_UPDATE_SIZE_HINTS;
  
***************
*** 2508,2513 ****
--- 2514,2520 ----
       * our structure.
       */
  
+     GetMaxSize(wmPtr, &maxWidth, &maxHeight);
      if (wmPtr->gridWin != NULL) {
  	hintsPtr->base_width = winPtr->reqWidth
  		- (wmPtr->reqGridWidth * wmPtr->widthInc);
***************
*** 2524,2537 ****
  	hintsPtr->min_height = hintsPtr->base_height
  		+ (wmPtr->minHeight * wmPtr->heightInc);
  	hintsPtr->max_width = hintsPtr->base_width
! 		+ (wmPtr->maxWidth * wmPtr->widthInc);
  	hintsPtr->max_height = hintsPtr->base_height
! 		+ (wmPtr->maxHeight * wmPtr->heightInc);
      } else {
  	hintsPtr->min_width = wmPtr->minWidth;
  	hintsPtr->min_height = wmPtr->minHeight;
! 	hintsPtr->max_width = wmPtr->maxWidth;
! 	hintsPtr->max_height = wmPtr->maxHeight;
  	hintsPtr->base_width = 0;
  	hintsPtr->base_height = 0;
      }
--- 2531,2544 ----
  	hintsPtr->min_height = hintsPtr->base_height
  		+ (wmPtr->minHeight * wmPtr->heightInc);
  	hintsPtr->max_width = hintsPtr->base_width
! 		+ (maxWidth * wmPtr->widthInc);
  	hintsPtr->max_height = hintsPtr->base_height
! 		+ (maxHeight * wmPtr->heightInc);
      } else {
  	hintsPtr->min_width = wmPtr->minWidth;
  	hintsPtr->min_height = wmPtr->minHeight;
! 	hintsPtr->max_width = maxWidth;
! 	hintsPtr->max_height = maxHeight;
  	hintsPtr->base_width = 0;
  	hintsPtr->base_height = 0;
      }
***************
*** 3756,3760 ****
--- 3763,3833 ----
  	    xPtr, yPtr, &mask) != True) {
  	*xPtr = -1;
  	*yPtr = -1;
+     }
+ }
+ 
+ /*
+  *----------------------------------------------------------------------
+  *
+  * GetMaxSize --
+  *
+  *	This procedure computes the current maxWidth and maxHeight
+  *	values for a window, taking into account the possibility
+  *	that they may be defaulted.
+  *
+  * Results:
+  *	The values at *maxWidthPtr and *maxHeightPtr are filled
+  *	in with the maximum allowable dimensions of wmPtr's window,
+  *	in grid units.  If no maximum has been specified for the
+  *	window, then this procedure computes the largest sizes that
+  *	will fit on the screen.
+  *
+  * Side effects:
+  *	None.
+  *
+  *----------------------------------------------------------------------
+  */
+ 
+ static void
+ GetMaxSize(wmPtr, maxWidthPtr, maxHeightPtr)
+     WmInfo *wmPtr;		/* Window manager information for the
+ 				 * window. */
+     int *maxWidthPtr;		/* Where to store the current maximum
+ 				 * width of the window. */
+     int *maxHeightPtr;		/* Where to store the current maximum
+ 				 * height of the window. */
+ {
+     int tmp;
+ 
+     if (wmPtr->maxWidth > 0) {
+ 	*maxWidthPtr = wmPtr->maxWidth;
+     } else {
+ 	/*
+ 	 * Must compute a default width.  Fill up the display, leaving a
+ 	 * bit of extra space for the window manager's borders.
+ 	 */
+ 
+ 	tmp = DisplayWidth(wmPtr->winPtr->display, wmPtr->winPtr->screenNum)
+ 	    - 15;
+ 	if (wmPtr->gridWin != NULL) {
+ 	    /*
+ 	     * Gridding is turned on;  convert from pixels to grid units.
+ 	     */
+ 
+ 	    tmp = wmPtr->reqGridWidth
+ 		    + (tmp - wmPtr->winPtr->reqWidth)/wmPtr->widthInc;
+ 	}
+ 	*maxWidthPtr = tmp;
+     }
+     if (wmPtr->maxHeight > 0) {
+ 	*maxHeightPtr = wmPtr->maxHeight;
+     } else {
+ 	tmp = DisplayHeight(wmPtr->winPtr->display, wmPtr->winPtr->screenNum)
+ 	    - 30;
+ 	if (wmPtr->gridWin != NULL) {
+ 	    tmp = wmPtr->reqGridHeight
+ 		    + (tmp - wmPtr->winPtr->reqHeight)/wmPtr->heightInc;
+ 	}
+ 	*maxHeightPtr = tmp;
      }
  }
*** ../tk4.0p2/./tkButton.c	Sat Jul 22 16:05:26 1995
--- ./tkButton.c	Mon Sep 25 14:56:28 1995
***************
*** 13,19 ****
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkButton.c 1.120 95/07/22 16:05:25";
  
  #include "default.h"
  #include "tkPort.h"
--- 13,19 ----
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkButton.c 1.121 95/09/25 14:56:29";
  
  #include "default.h"
  #include "tkPort.h"
***************
*** 1311,1319 ****
  	    y += butPtr->borderWidth;
  	    dim -= 2*butPtr->borderWidth;
  	    if (butPtr->flags & SELECTED) {
! 		XFillRectangle(butPtr->display, pixmap, Tk_3DBorderGC(tkwin,
! 			butPtr->selectBorder, TK_3D_FLAT_GC),
! 			x, y, (unsigned int) dim, (unsigned int) dim);
  	    } else {
  		Tk_Fill3DRectangle(tkwin, pixmap, butPtr->normalBorder, x, y,
  			dim, dim, butPtr->borderWidth, TK_RELIEF_FLAT);
--- 1311,1323 ----
  	    y += butPtr->borderWidth;
  	    dim -= 2*butPtr->borderWidth;
  	    if (butPtr->flags & SELECTED) {
! 		GC gc;
! 
! 		gc = Tk_3DBorderGC(tkwin,(butPtr->selectBorder != NULL)
! 			? butPtr->selectBorder : butPtr->normalBorder,
! 			TK_3D_FLAT_GC);
! 		XFillRectangle(butPtr->display, pixmap, gc, x, y,
! 			(unsigned int) dim, (unsigned int) dim);
  	    } else {
  		Tk_Fill3DRectangle(tkwin, pixmap, butPtr->normalBorder, x, y,
  			dim, dim, butPtr->borderWidth, TK_RELIEF_FLAT);
***************
*** 1333,1341 ****
  	points[3].x = points[1].x;
  	points[3].y = points[0].y - radius;
  	if (butPtr->flags & SELECTED) {
! 	    XFillPolygon(butPtr->display, pixmap,
! 		    Tk_3DBorderGC(tkwin, butPtr->selectBorder, TK_3D_FLAT_GC),
! 		    points, 4, Convex, CoordModeOrigin);
  	} else {
  	    Tk_Fill3DPolygon(tkwin, pixmap, butPtr->normalBorder, points,
  		    4, butPtr->borderWidth, TK_RELIEF_FLAT);
--- 1337,1349 ----
  	points[3].x = points[1].x;
  	points[3].y = points[0].y - radius;
  	if (butPtr->flags & SELECTED) {
! 	    GC gc;
! 
! 	    gc = Tk_3DBorderGC(tkwin, (butPtr->selectBorder != NULL)
! 		    ? butPtr->selectBorder : butPtr->normalBorder,
! 		    TK_3D_FLAT_GC);
! 	    XFillPolygon(butPtr->display, pixmap, gc, points, 4, Convex,
! 		    CoordModeOrigin);
  	} else {
  	    Tk_Fill3DPolygon(tkwin, pixmap, butPtr->normalBorder, points,
  		    4, butPtr->borderWidth, TK_RELIEF_FLAT);
*** ../tk4.0p2/./tkEntry.c	Sun May 28 17:50:03 1995
--- ./tkEntry.c	Tue Sep 26 13:33:15 1995
***************
*** 12,18 ****
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkEntry.c 1.90 95/05/28 17:49:57";
  
  #include "default.h"
  #include "tkPort.h"
--- 12,18 ----
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkEntry.c 1.91 95/09/26 13:33:13";
  
  #include "default.h"
  #include "tkPort.h"
***************
*** 299,304 ****
--- 299,305 ----
  			    Tcl_Interp *interp, char *name1, char *name2,
  			    int flags));
  static void		EntryUpdateScrollbar _ANSI_ARGS_((Entry *entryPtr));
+ static void		EntryValueChanged _ANSI_ARGS_((Entry *entryPtr));
  static void		EntryVisibleRange _ANSI_ARGS_((Entry *entryPtr,
  			    double *firstPtr, double *lastPtr));
  static int		EntryWidgetCmd _ANSI_ARGS_((ClientData clientData,
***************
*** 863,870 ****
  
  	value = Tcl_GetVar(interp, entryPtr->textVarName, TCL_GLOBAL_ONLY);
  	if (value == NULL) {
! 	    Tcl_SetVar(interp, entryPtr->textVarName, entryPtr->string,
! 		    TCL_GLOBAL_ONLY);
  	} else {
  	    EntrySetValue(entryPtr, value);
  	}
--- 864,870 ----
  
  	value = Tcl_GetVar(interp, entryPtr->textVarName, TCL_GLOBAL_ONLY);
  	if (value == NULL) {
! 	    EntryValueChanged(entryPtr);
  	} else {
  	    EntrySetValue(entryPtr, value);
  	}
***************
*** 1334,1347 ****
      if (entryPtr->insertPos >= index) {
  	entryPtr->insertPos += length;
      }
! 
!     if (entryPtr->textVarName != NULL) {
! 	Tcl_SetVar(entryPtr->interp, entryPtr->textVarName, entryPtr->string,
! 		TCL_GLOBAL_ONLY);
!     }
!     entryPtr->flags |= UPDATE_SCROLLBAR;
!     EntryComputeGeometry(entryPtr);
!     EventuallyRedraw(entryPtr);
  }
  
  /*
--- 1334,1340 ----
      if (entryPtr->insertPos >= index) {
  	entryPtr->insertPos += length;
      }
!     EntryValueChanged(entryPtr);
  }
  
  /*
***************
*** 1427,1440 ****
  	    entryPtr->insertPos = index;
  	}
      }
  
!     if (entryPtr->textVarName != NULL) {
! 	Tcl_SetVar(entryPtr->interp, entryPtr->textVarName, entryPtr->string,
! 		TCL_GLOBAL_ONLY);
      }
!     entryPtr->flags |= UPDATE_SCROLLBAR;
!     EntryComputeGeometry(entryPtr);
!     EventuallyRedraw(entryPtr);
  }
  
  /*
--- 1420,1479 ----
  	    entryPtr->insertPos = index;
  	}
      }
+     EntryValueChanged(entryPtr);
+ }
+ 
+ /*
+  *----------------------------------------------------------------------
+  *
+  * EntryValueChanged --
+  *
+  *	This procedure is invoked when characters are inserted into
+  *	an entry or deleted from it.  It updates the entry's associated
+  *	variable, if there is one, and does other bookkeeping such
+  *	as arranging for redisplay.
+  *
+  * Results:
+  *	None.
+  *
+  * Side effects:
+  *	None.
+  *
+  *----------------------------------------------------------------------
+  */
  
! static void
! EntryValueChanged(entryPtr)
!     Entry *entryPtr;		/* Entry whose value just changed. */
! {
!     char *newValue;
! 
!     if (entryPtr->textVarName == NULL) {
! 	newValue = NULL;
!     } else {
! 	newValue = Tcl_SetVar(entryPtr->interp, entryPtr->textVarName,
! 		entryPtr->string, TCL_GLOBAL_ONLY);
      }
! 
!     if ((newValue != NULL) && (strcmp(newValue, entryPtr->string) != 0)) {
! 	/*
! 	 * The value of the variable is different than what we asked for.
! 	 * This means that a trace on the variable modified it.  In this
! 	 * case our trace procedure wasn't invoked since the modification
! 	 * came while a trace was already active on the variable.  So,
! 	 * update our value to reflect the variable's latest value.
! 	 */
! 
! 	EntrySetValue(entryPtr, newValue);
!     } else {
! 	/*
! 	 * Arrange for redisplay.
! 	 */
! 
! 	entryPtr->flags |= UPDATE_SCROLLBAR;
! 	EntryComputeGeometry(entryPtr);
! 	EventuallyRedraw(entryPtr);
!     }
  }
  
  /*
*** ../tk4.0p2/./tkListbox.c	Tue Jul 25 12:50:15 1995
--- ./tkListbox.c	Tue Sep 26 16:18:24 1995
***************
*** 12,18 ****
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkListbox.c 1.97 95/07/25 12:50:13";
  
  #include "tkPort.h"
  #include "default.h"
--- 12,18 ----
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkListbox.c 1.99 95/09/26 16:18:22";
  
  #include "tkPort.h"
  #include "default.h"
***************
*** 790,796 ****
  		case TK_SCROLL_ERROR:
  		    goto error;
  		case TK_SCROLL_MOVETO:
! 		    offset = fraction*listPtr->maxWidth;
  		    break;
  		case TK_SCROLL_PAGES:
  		    windowUnits = windowWidth/listPtr->xScrollUnit;
--- 790,796 ----
  		case TK_SCROLL_ERROR:
  		    goto error;
  		case TK_SCROLL_MOVETO:
! 		    offset = fraction*listPtr->maxWidth + 0.5;
  		    break;
  		case TK_SCROLL_PAGES:
  		    windowUnits = windowWidth/listPtr->xScrollUnit;
***************
*** 835,841 ****
  		case TK_SCROLL_ERROR:
  		    goto error;
  		case TK_SCROLL_MOVETO:
! 		    index = listPtr->numElements*fraction;
  		    break;
  		case TK_SCROLL_PAGES:
  		    if (listPtr->fullLines > 2) {
--- 835,841 ----
  		case TK_SCROLL_ERROR:
  		    goto error;
  		case TK_SCROLL_MOVETO:
! 		    index = listPtr->numElements*fraction + 0.5;
  		    break;
  		case TK_SCROLL_PAGES:
  		    if (listPtr->fullLines > 2) {
*** ../tk4.0p2/./tkMenubutton.c	Fri Jun  9 08:20:08 1995
--- ./tkMenubutton.c	Sun Nov 19 16:06:56 1995
***************
*** 11,17 ****
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkMenubutton.c 1.70 95/06/09 08:20:02";
  
  #include "tkPort.h"
  #include "default.h"
--- 11,17 ----
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkMenubutton.c 1.71 95/11/19 16:06:57";
  
  #include "tkPort.h"
  #include "default.h"
***************
*** 636,642 ****
  
      gcValues.font = mbPtr->fontPtr->fid;
      gcValues.background = Tk_3DBorderColor(mbPtr->normalBorder)->pixel;
!     if (mbPtr->disabledFg != NULL) {
  	gcValues.foreground = mbPtr->disabledFg->pixel;
  	mask = GCForeground|GCBackground|GCFont;
      } else {
--- 636,642 ----
  
      gcValues.font = mbPtr->fontPtr->fid;
      gcValues.background = Tk_3DBorderColor(mbPtr->normalBorder)->pixel;
!     if ((mbPtr->disabledFg != NULL) && (mbPtr->imageString == NULL)) {
  	gcValues.foreground = mbPtr->disabledFg->pixel;
  	mask = GCForeground|GCBackground|GCFont;
      } else {
***************
*** 889,895 ****
       * foreground color, generate the stippled effect.
       */
  
!     if ((mbPtr->state == tkDisabledUid) && (mbPtr->disabledFg == NULL)) {
  	XFillRectangle(mbPtr->display, pixmap, mbPtr->disabledGC,
  		mbPtr->inset, mbPtr->inset,
  		(unsigned) (Tk_Width(tkwin) - 2*mbPtr->inset),
--- 889,896 ----
       * foreground color, generate the stippled effect.
       */
  
!     if ((mbPtr->state == tkDisabledUid)
! 	    && ((mbPtr->disabledFg == NULL) || (mbPtr->image != NULL))) {
  	XFillRectangle(mbPtr->display, pixmap, mbPtr->disabledGC,
  		mbPtr->inset, mbPtr->inset,
  		(unsigned) (Tk_Width(tkwin) - 2*mbPtr->inset),
*** ../tk4.0p2/./tkScale.c	Fri Jun  9 08:20:08 1995
--- ./tkScale.c	Sat Nov 25 22:47:14 1995
***************
*** 18,24 ****
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkScale.c 1.72 95/06/09 08:20:04";
  
  #include "tkPort.h"
  #include "default.h"
--- 18,24 ----
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkScale.c 1.73 95/11/25 22:47:16";
  
  #include "tkPort.h"
  #include "default.h"
***************
*** 722,728 ****
  	if (stringValue != NULL) {
  	    value = strtod(stringValue, &end);
  	    if ((end != stringValue) && (*end == 0)) {
! 		scalePtr->value = value;
  	    }
  	}
  	Tcl_TraceVar(interp, scalePtr->varName,
--- 722,728 ----
  	if (stringValue != NULL) {
  	    value = strtod(stringValue, &end);
  	    if ((end != stringValue) && (*end == 0)) {
! 		scalePtr->value = RoundToResolution(scalePtr, value);
  	    }
  	}
  	Tcl_TraceVar(interp, scalePtr->varName,
***************
*** 1953,1972 ****
      Scale *scalePtr;		/* Information about scale widget. */
      double value;		/* Value to round. */
  {
!     double rem;
  
      if (scalePtr->resolution <= 0) {
  	return value;
      }
!     rem = fmod(value, scalePtr->resolution);
      if (rem < 0) {
! 	rem = scalePtr->resolution + rem;
      }
!     value -= rem;
!     if (rem >= scalePtr->resolution/2) {
! 	value += scalePtr->resolution;
!     }
!     return value;
  }
  
  /*
--- 1953,1975 ----
      Scale *scalePtr;		/* Information about scale widget. */
      double value;		/* Value to round. */
  {
!     double rem, new;
  
      if (scalePtr->resolution <= 0) {
  	return value;
      }
!     new = scalePtr->resolution * floor(value/scalePtr->resolution);
!     rem = value - new;
      if (rem < 0) {
! 	if (rem <= -scalePtr->resolution/2) {
! 	    new -= scalePtr->resolution;
! 	}
!     } else {
! 	if (rem >= scalePtr->resolution/2) {
! 	    new += scalePtr->resolution;
! 	}
      }
!     return new;
  }
  
  /*
***************
*** 2033,2039 ****
  	if ((end == stringValue) || (*end != 0)) {
  	    result = "can't assign non-numeric value to scale variable";
  	} else {
! 	    scalePtr->value = value;
  	}
  
  	/*
--- 2036,2042 ----
  	if ((end == stringValue) || (*end != 0)) {
  	    result = "can't assign non-numeric value to scale variable";
  	} else {
! 	    scalePtr->value = RoundToResolution(scalePtr, value);
  	}
  
  	/*
*** ../tk4.0p2/./tkCanvas.c	Wed Aug 16 09:42:14 1995
--- ./tkCanvas.c	Fri Nov 24 15:46:15 1995
***************
*** 12,18 ****
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkCanvas.c 1.103 95/08/16 09:42:13";
  
  #include "default.h"
  #include "tkInt.h"
--- 12,18 ----
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkCanvas.c 1.104 95/11/24 15:46:15";
  
  #include "default.h"
  #include "tkInt.h"
***************
*** 2873,2879 ****
   * Side effects:
   *	The current item for canvasPtr may change.  If it does,
   *	then the commands associated with item entry and exit
!  *	could do just about anything.
   *
   *--------------------------------------------------------------
   */
--- 2873,2881 ----
   * Side effects:
   *	The current item for canvasPtr may change.  If it does,
   *	then the commands associated with item entry and exit
!  *	could do just about anything.  A binding script could
!  *	delete the canvas, so callers should protect themselves
!  *	with Tk_Preserve and Tk_Release.
   *
   *--------------------------------------------------------------
   */
***************
*** 3109,3115 ****
   *	None.
   *
   * Side effects:
!  *	Depends on the bindings for the canvas.
   *
   *--------------------------------------------------------------
   */
--- 3111,3119 ----
   *	None.
   *
   * Side effects:
!  *	Depends on the bindings for the canvas.  A binding script
!  *	could delete the canvas, so callers should protect themselves
!  *	with Tk_Preserve and Tk_Release.
   *
   *--------------------------------------------------------------
   */
***************
*** 3165,3172 ****
       * it was malloc-ed.
       */
  
!     Tk_BindEvent(canvasPtr->bindingTable, eventPtr, canvasPtr->tkwin,
! 	    numObjects, objectPtr);
      if (objectPtr != staticObjects) {
  	ckfree((char *) objectPtr);
      }
--- 3169,3178 ----
       * it was malloc-ed.
       */
  
!     if (canvasPtr->tkwin != NULL) {
! 	Tk_BindEvent(canvasPtr->bindingTable, eventPtr, canvasPtr->tkwin,
! 		numObjects, objectPtr);
!     }
      if (objectPtr != staticObjects) {
  	ckfree((char *) objectPtr);
      }
*** ../tk4.0p2/./tkCanvLine.c	Fri Jun  9 09:46:57 1995
--- ./tkCanvLine.c	Wed Oct 11 14:07:17 1995
***************
*** 10,16 ****
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkCanvLine.c 1.35 95/06/09 09:46:54";
  
  #include <stdio.h>
  #include "tkInt.h"
--- 10,16 ----
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkCanvLine.c 1.36 95/10/11 14:07:14";
  
  #include <stdio.h>
  #include "tkInt.h"
***************
*** 813,819 ****
  				 * had to be treated as beveled after all
  				 * because the angle was < 11 degrees. */
  
!     bestDist = 1.0e40;
  
      /*
       * Handle smoothed lines by generating an expanded set of points
--- 813,819 ----
  				 * had to be treated as beveled after all
  				 * because the angle was < 11 degrees. */
  
!     bestDist = 1.0e36;
  
      /*
       * Handle smoothed lines by generating an expanded set of points
*** ../tk4.0p2/./tkCanvPs.c	Fri Aug  4 10:05:09 1995
--- ./tkCanvPs.c	Thu Nov  9 11:34:10 1995
***************
*** 12,18 ****
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkCanvPs.c 1.36 95/08/04 10:05:08";
  
  #include <stdio.h>
  #include "tkInt.h"
--- 12,18 ----
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkCanvPs.c 1.37 95/11/09 11:34:12";
  
  #include <stdio.h>
  #include "tkInt.h"
***************
*** 722,728 ****
  	    }
  	    sprintf(pointString, "%.15g", size);
  	    Tcl_AppendResult(interp, "/", argv[0], " findfont ",
! 		    pointString, " scalefont setfont\n", (char *) NULL);
  	    Tcl_CreateHashEntry(&psInfoPtr->fontTable, argv[0], &i);
  	    ckfree((char *) argv);
  	    return TCL_OK;
--- 722,732 ----
  	    }
  	    sprintf(pointString, "%.15g", size);
  	    Tcl_AppendResult(interp, "/", argv[0], " findfont ",
! 		    pointString, " scalefont ", (char *) NULL);
! 	    if (strncasecmp(argv[0], "Symbol", 7) != 0) {
! 		Tcl_AppendResult(interp, "ISOEncode ", (char *) NULL);
! 	    }
! 	    Tcl_AppendResult(interp, "setfont\n", (char *) NULL);
  	    Tcl_CreateHashEntry(&psInfoPtr->fontTable, argv[0], &i);
  	    ckfree((char *) argv);
  	    return TCL_OK;
***************
*** 814,820 ****
      }
      sprintf(pointString, "%.15g", ((double) points)/10.0);
      Tcl_AppendResult(interp, "/", fontName, " findfont ",
! 	    pointString, " scalefont setfont\n", (char *) NULL);
      Tcl_CreateHashEntry(&psInfoPtr->fontTable, fontName, &i);
      return TCL_OK;
  
--- 818,828 ----
      }
      sprintf(pointString, "%.15g", ((double) points)/10.0);
      Tcl_AppendResult(interp, "/", fontName, " findfont ",
! 	    pointString, " scalefont ", (char *) NULL);
!     if (strcmp(fontName, "Symbol ") != 0) {
! 	Tcl_AppendResult(interp, "ISOEncode ", (char *) NULL);
!     }
!     Tcl_AppendResult(interp, "setfont\n", (char *) NULL);
      Tcl_CreateHashEntry(&psInfoPtr->fontTable, fontName, &i);
      return TCL_OK;
  
*** ../tk4.0p2/./tkRectOval.c	Thu Mar 16 08:34:03 1995
--- ./tkRectOval.c	Sun Oct  1 16:28:51 1995
***************
*** 11,17 ****
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkRectOval.c 1.31 95/01/03 17:06:03";
  
  #include <stdio.h>
  #include "tk.h"
--- 11,17 ----
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkRectOval.c 1.32 95/10/01 16:28:50";
  
  #include <stdio.h>
  #include "tk.h"
***************
*** 455,462 ****
      } else {
  	bloat = (rectOvalPtr->width+1)/2;
      }
!     rectOvalPtr->header.x1 = rectOvalPtr->bbox[0] - bloat;
!     rectOvalPtr->header.y1 = rectOvalPtr->bbox[1] - bloat;
      rectOvalPtr->header.x2 = rectOvalPtr->bbox[2] + bloat + 1;
      rectOvalPtr->header.y2 = rectOvalPtr->bbox[3] + bloat + 1;
  }
--- 455,469 ----
      } else {
  	bloat = (rectOvalPtr->width+1)/2;
      }
! 
!     /*
!      * Note:  add an extra pixel to the bounding box on all sides to
!      * account for rounding error (e.g. negative coords will be rounded
!      * differently than positive ones).
!      */
! 
!     rectOvalPtr->header.x1 = rectOvalPtr->bbox[0] - bloat - 1;
!     rectOvalPtr->header.y1 = rectOvalPtr->bbox[1] - bloat - 1;
      rectOvalPtr->header.x2 = rectOvalPtr->bbox[2] + bloat + 1;
      rectOvalPtr->header.y2 = rectOvalPtr->bbox[3] + bloat + 1;
  }
*** ../tk4.0p2/./tkTrig.c	Fri Jun  9 09:46:57 1995
--- ./tkTrig.c	Wed Oct 11 14:07:17 1995
***************
*** 13,19 ****
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkTrig.c 1.21 95/06/09 09:46:57";
  
  #include <stdio.h>
  #include "tkInt.h"
--- 13,19 ----
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkTrig.c 1.22 95/10/11 14:07:16";
  
  #include <stdio.h>
  #include "tkInt.h"
***************
*** 465,471 ****
       * count it as two intersections.
       */
  
!     bestDist = 1.0e40;
      intersections = 0;
  
      for (count = numPoints, pPtr = polyPtr; count > 1; count--, pPtr += 2) {
--- 465,471 ----
       * count it as two intersections.
       */
  
!     bestDist = 1.0e36;
      intersections = 0;
  
      for (count = numPoints, pPtr = polyPtr; count > 1; count--, pPtr += 2) {
*** ../tk4.0p2/./tkTextDisp.c	Sat Jul 22 17:17:20 1995
--- ./tkTextDisp.c	Tue Nov 21 13:15:26 1995
***************
*** 12,18 ****
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkTextDisp.c 1.92 95/07/22 17:17:18";
  
  #include "tkPort.h"
  #include "tkInt.h"
--- 12,18 ----
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkTextDisp.c 1.96 95/11/21 13:15:27";
  
  #include "tkPort.h"
  #include "tkInt.h"
***************
*** 747,752 ****
--- 747,756 ----
  					 * style for first character on line. */
      int tabSize;			/* Number of pixels consumed by current
  					 * tab stop. */
+     TkTextDispChunk *lastCharChunkPtr;	/* Pointer to last chunk in display
+ 					 * lines with numChars > 0.  Used to
+ 					 * drop 0-sized chunks from the end
+ 					 * of the line. */
      int offset, ascent, descent, code;
      StyleValues *sValuePtr;
  
***************
*** 785,790 ****
--- 789,795 ----
      rMargin = 0;
      wrapMode = tkTextCharUid;
      tabSize = 0;
+     lastCharChunkPtr = NULL;
  
      /*
       * Find the first segment to consider for the line.  Can't call
***************
*** 885,890 ****
--- 890,896 ----
  	}
  	if (chunkPtr->numChars > 0) {
  	    noCharsYet = 0;
+ 	    lastCharChunkPtr = chunkPtr;
  	}
  	if (lastChunkPtr == NULL) {
  	    dlPtr->chunkPtr = chunkPtr;
***************
*** 940,945 ****
--- 946,963 ----
       * potentially require the last chunk to be layed out again.
       */
  
+     if (breakChunkPtr == NULL) {
+ 	/*
+ 	 * This code makes sure that we don't accidentally display
+ 	 * chunks with no characters at the end of the line (such as
+ 	 * the insertion cursor).  These chunks belong on the next
+ 	 * line.  So, throw away everything after the last chunk that
+ 	 * has characters in it.
+ 	 */
+ 
+ 	breakChunkPtr = lastCharChunkPtr;
+ 	breakCharOffset = breakChunkPtr->numChars;
+     }
      if ((breakChunkPtr != NULL) && ((lastChunkPtr != breakChunkPtr)
  	    || (breakCharOffset != lastChunkPtr->numChars))) {
  	while (1) {
***************
*** 1198,1203 ****
--- 1216,1226 ----
  	    newPtr = dlPtr->nextPtr;
  	    FreeDLines(textPtr, dlPtr, newPtr, 0);
  	    dlPtr = newPtr;
+ 	    if (prevPtr != NULL) {
+ 		prevPtr->nextPtr = newPtr;
+ 	    } else {
+ 		dInfoPtr->dLinePtr = newPtr;
+ 	    }
  	    continue;
  	}
  
***************
*** 2759,2765 ****
  {
      DInfo *dInfoPtr = textPtr->dInfoPtr;
      register DLine *dlPtr;
!     int bottomY, close, lineIndex;
      TkTextIndex tmpIndex, rounded;
  
      /*
--- 2782,2788 ----
  {
      DInfo *dInfoPtr = textPtr->dInfoPtr;
      register DLine *dlPtr;
!     int bottomY, close, lineIndex, lineHeight;
      TkTextIndex tmpIndex, rounded;
  
      /*
***************
*** 2815,2825 ****
      }
  
      /*
!      * The desired line isn't already on-screen.
       */
  
!     bottomY = (dInfoPtr->y + dInfoPtr->maxY)/2;
      close = (dInfoPtr->maxY - dInfoPtr->y)/3;
      if (dlPtr != NULL) {
  	/*
  	 * The desired line is above the top of screen.  If it is
--- 2838,2857 ----
      }
  
      /*
!      * The desired line isn't already on-screen.  Figure out what
!      * it means to be "close" to the top or bottom of the screen.
!      * Close means within 1/3 of the screen height or within three
!      * lines, whichever is greater.  Add one extra line also, to
!      * account for the way MeasureUp rounds.
       */
  
!     lineHeight = textPtr->fontPtr->ascent + textPtr->fontPtr->descent;
!     bottomY = (dInfoPtr->y + dInfoPtr->maxY + lineHeight)/2;
      close = (dInfoPtr->maxY - dInfoPtr->y)/3;
+     if (close < 3*lineHeight) {
+ 	close = 3*lineHeight;
+     }
+     close += lineHeight;
      if (dlPtr != NULL) {
  	/*
  	 * The desired line is above the top of screen.  If it is
***************
*** 2850,2856 ****
       * as low on the screen as possible but with its bottom no lower
       * than bottomY.  BottomY is the bottom of the window if the
       * desired line is just below the current screen, otherwise it
!      * is the center of the window.
       */
  
      MeasureUp(textPtr, indexPtr, bottomY, &textPtr->topIndex);
--- 2882,2888 ----
       * as low on the screen as possible but with its bottom no lower
       * than bottomY.  BottomY is the bottom of the window if the
       * desired line is just below the current screen, otherwise it
!      * is a half-line lower than the center of the window.
       */
  
      MeasureUp(textPtr, indexPtr, bottomY, &textPtr->topIndex);
***************
*** 3133,3139 ****
  	case TK_SCROLL_ERROR:
  	    return TCL_ERROR;
  	case TK_SCROLL_MOVETO:
! 	    newOffset = (fraction * dInfoPtr->maxLength) / textPtr->charWidth;
  	    break;
  	case TK_SCROLL_PAGES:
  	    charsPerPage = ((dInfoPtr->maxX - dInfoPtr->x) / textPtr->charWidth)
--- 3165,3178 ----
  	case TK_SCROLL_ERROR:
  	    return TCL_ERROR;
  	case TK_SCROLL_MOVETO:
! 	    if (fraction > 1.0) {
! 		fraction = 1.0;
! 	    }
! 	    if (fraction < 0) {
! 		fraction = 0;
! 	    }
!   	    newOffset = ((fraction * dInfoPtr->maxLength) / textPtr->charWidth)
! 		    + 0.5;
  	    break;
  	case TK_SCROLL_PAGES:
  	    charsPerPage = ((dInfoPtr->maxX - dInfoPtr->x) / textPtr->charWidth)
***************
*** 3359,3374 ****
  	case TK_SCROLL_ERROR:
  	    return TCL_ERROR;
  	case TK_SCROLL_MOVETO:
  	    fraction *= TkBTreeNumLines(textPtr->tree);
  	    lineNum = fraction;
! 	    TkTextMakeIndex(textPtr->tree, lineNum+1, 0, &index);
! 	    TkTextIndexBackChars(&index, 1, &index);
! 	    index.charIndex = (index.charIndex+1)*(fraction-lineNum);
  	    TkTextSetYView(textPtr, &index, 0);
  	    break;
  	case TK_SCROLL_PAGES:
  	    /*
! 	     * Scroll up or down by screenfulls.  Actually, use the
  	     * window height minus two lines, so that there's some
  	     * overlap between adjacent pages.
  	     */
--- 3398,3419 ----
  	case TK_SCROLL_ERROR:
  	    return TCL_ERROR;
  	case TK_SCROLL_MOVETO:
+ 	    if (fraction > 1.0) {
+ 		fraction = 1.0;
+ 	    }
+ 	    if (fraction < 0) {
+ 		fraction = 0;
+ 	    }
  	    fraction *= TkBTreeNumLines(textPtr->tree);
  	    lineNum = fraction;
! 	    TkTextMakeIndex(textPtr->tree, lineNum, 0, &index);
! 	    index.charIndex = TkBTreeCharsInLine(index.linePtr)
! 		    * (fraction-lineNum) + 0.5;
  	    TkTextSetYView(textPtr, &index, 0);
  	    break;
  	case TK_SCROLL_PAGES:
  	    /*
! 	     * Scroll up or down by screenfuls.  Actually, use the
  	     * window height minus two lines, so that there's some
  	     * overlap between adjacent pages.
  	     */
*** ../tk4.0p2/./tkTextTag.c	Thu May 25 10:36:16 1995
--- ./tkTextTag.c	Fri Nov 24 15:46:16 1995
***************
*** 12,18 ****
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkTextTag.c 1.28 95/05/25 10:36:17";
  
  #include "default.h"
  #include "tkPort.h"
--- 12,18 ----
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   */
  
! static char sccsid[] = "@(#) tkTextTag.c 1.29 95/11/24 15:46:17";
  
  #include "default.h"
  #include "tkPort.h"
***************
*** 1108,1114 ****
  	}
  	TkTextPickCurrent(textPtr, eventPtr);
      }
!     if ((textPtr->numCurTags > 0) && (textPtr->bindingTable != NULL)) {
  	Tk_BindEvent(textPtr->bindingTable, eventPtr, textPtr->tkwin,
  		textPtr->numCurTags, (ClientData *) textPtr->curTagArrayPtr);
      }
--- 1108,1115 ----
  	}
  	TkTextPickCurrent(textPtr, eventPtr);
      }
!     if ((textPtr->numCurTags > 0) && (textPtr->bindingTable != NULL)
! 	    && (textPtr->tkwin != NULL)) {
  	Tk_BindEvent(textPtr->bindingTable, eventPtr, textPtr->tkwin,
  		textPtr->numCurTags, (ClientData *) textPtr->curTagArrayPtr);
      }
***************
*** 1143,1149 ****
   * Side effects:
   *	The current mark for textPtr may change.  If it does,
   *	then the commands associated with character entry and leave
!  *	could do just about anything.
   *
   *--------------------------------------------------------------
   */
--- 1144,1152 ----
   * Side effects:
   *	The current mark for textPtr may change.  If it does,
   *	then the commands associated with character entry and leave
!  *	could do just about anything.  For example, the text widget
!  *	might be deleted.  It is up to the caller to protect itself
!  *	with calls to Tk_Preserve and Tk_Release.
   *
   *--------------------------------------------------------------
   */
***************
*** 1278,1284 ****
      oldArrayPtr = textPtr->curTagArrayPtr;
      textPtr->curTagArrayPtr = newArrayPtr;
      if (numOldTags != 0) {
! 	if (textPtr->bindingTable != NULL) {
  	    event = textPtr->pickEvent;
  	    event.type = LeaveNotify;
  
--- 1281,1287 ----
      oldArrayPtr = textPtr->curTagArrayPtr;
      textPtr->curTagArrayPtr = newArrayPtr;
      if (numOldTags != 0) {
! 	if ((textPtr->bindingTable != NULL) && (textPtr->tkwin != NULL)) {
  	    event = textPtr->pickEvent;
  	    event.type = LeaveNotify;
  
***************
*** 1306,1312 ****
  	    textPtr->pickEvent.xcrossing.y, &index);
      TkTextSetMark(textPtr, "current", &index);
      if (numNewTags != 0) {
! 	if (textPtr->bindingTable != NULL) {
  	    event = textPtr->pickEvent;
  	    event.type = EnterNotify;
  	    event.xcrossing.detail = NotifyAncestor;
--- 1309,1315 ----
  	    textPtr->pickEvent.xcrossing.y, &index);
      TkTextSetMark(textPtr, "current", &index);
      if (numNewTags != 0) {
! 	if ((textPtr->bindingTable != NULL) && (textPtr->tkwin != NULL)) {
  	    event = textPtr->pickEvent;
  	    event.type = EnterNotify;
  	    event.xcrossing.detail = NotifyAncestor;
*** ../tk4.0p2/./tkInt.h	Sat Jun 24 17:12:55 1995
--- ./tkInt.h	Mon Sep 25 13:19:01 1995
***************
*** 10,16 ****
   * See the file "license.terms" for information on usage and redistribution
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   *
!  * @(#) tkInt.h 1.147 95/06/24 17:12:55
   */
  
  #ifndef _TKINT
--- 10,16 ----
   * See the file "license.terms" for information on usage and redistribution
   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
   *
!  * @(#) tkInt.h 1.149 95/09/25 13:19:00
   */
  
  #ifndef _TKINT
*** ../tk4.0p2/./changes	Mon Sep 18 13:27:53 1995
--- ./changes	Mon Nov 27 09:02:16 1995
***************
*** 2,8 ****
  released on March 13, 1991.  Changes that aren't backward compatible
  are marked specially.
  
! sccsid = @(#) changes 1.23 95/09/18 13:27:50
  
  3/16/91 (bug fix) Modified tkWindow.c to remove Tk's Tcl commands from
  the interpreter when the main window is deleted (otherwise there will
--- 2,8 ----
  released on March 13, 1991.  Changes that aren't backward compatible
  are marked specially.
  
! sccsid = @(#) changes 1.26 95/11/27 09:02:19
  
  3/16/91 (bug fix) Modified tkWindow.c to remove Tk's Tcl commands from
  the interpreter when the main window is deleted (otherwise there will
***************
*** 2506,2511 ****
  could occasionally happen in tkScaleDrag. (JO)
  
  9/19/95 (bug fix) Fixed bug in text index processing that causes
! tests textIndex-11.1 and textIndex12.1 to fail on some platforms.
  
  ----------------- Released patch 4.0p2, 9/19/95 ----------------------
--- 2506,2624 ----
  could occasionally happen in tkScaleDrag. (JO)
  
  9/19/95 (bug fix) Fixed bug in text index processing that causes
! tests textIndex-11.1 and textIndex12.1 to fail on some platforms. (JO)
  
  ----------------- Released patch 4.0p2, 9/19/95 ----------------------
+ 
+ 9/22/95 (bug fix) Fixed bug where text widgets could occasionally
+ display the insertion cursor both at the end of one line and the
+ beginning of the next. (JO)
+ 
+ 9/25/95 (bug fix) Text widgets sometimes scrolled backwards on
+ occasion if you dragged down past the bottom of the scrollbar. (JO)
+ 
+ 9/25/95 (bug fix) Fixed bug in menus where a cascaded submenu posted
+ from a torn-off menu could be left posted if mouse was pulled off the
+ end of the cascade and released. (JO)
+ 
+ 9/25/95 (new feature) Added "--" switch to wish, so that you can
+ pass arguments like -n through to a script without having wish
+ interpret them. (JO)
+ 
+ 9/25/95 (bug fix) Fixed core dump that could occur for radiobuttons
+ and selectbuttons if -selectcolor was an empty string. (JO)
+ 
+ 9/26/95 (bug fix) Entries didn't used to notice if a trace procedure
+ on the -textvariable overrode a new value set by the entry.  This
+ could cause the variable to get out of sync with the contents of the
+ entry. (JO)
+ 
+ 9/26/95 (bug fix) Fixed round-off errors in listbox scrolling.  Among
+ other things, this could cause listbox view to shift slightly at
+ unexpected times. (JO)
+ 
+ 9/26/95 (bug fix) TkColor.c wasn't computing colormap size correctly;
+ could result in X Protocol error for QueryColors when colormaps run
+ out of colors. (JO)
+ 
+ 9/27/95 (feature change)  Modified tk_dialog so that it uses the
+ option database for the -wraplength option on the message.  This
+ allows the option to be overridden by the caller. (JO)
+ 
+ 10/1/95 (bug fix) Canvas rectangles weren't computing their bounding
+ boxes correctly when coordinates were negative, resulting in improper
+ redisplay (e.g. junk left behind) when dragging. (JO)
+ 
+ 10/30/95 (bug fix) When focus-follows-mode (invoked via tk_focusFollowsMouse),
+ was focussing on windows even in situations where keyboard traversal would
+ skip the window.  Changed to use the tkFocusOK procedure so that the
+ criteria for focussing are the same in both modes. (JO)
+ 
+ 11/2/95 (bug fix) Changed listbox bindings to ignore double-clicks.
+ This avoids errors that used to occur if a user defined a binding
+ for double-click that deleted the listbox. (JO)
+ 
+ 11/7/95 (bug fix) If wish was invoked with a command-line geometry and
+ a script file (e.g. "wish foo.tcl -geometry 30x20"), and if one of
+ the windows created by the script used the -setgrid option, then the
+ width and height from the command line were lost. (JO)
+ 
+ 11/8/95 (bug fix) The "see" command didn't work quite right for texts:
+ if the window was small and you try to "see" a line just offscreen,
+ Tk centered the line (actually, mis-centered it) when it should have
+ aligned it at the top or bottom. (JO)
+ 
+ 11/9/95 (bug fix) The "send" command crashed if you tried to send to
+ a different display with "-displayof". (JO)
+ 
+ 11/9/95 (bug fix) The Symbol font didn't print right in Postscript
+ output, because of changes made to re-encode fonts to get proper
+ ISO Latin1 behavior.  Changed the code not to re-encode the Symbol
+ font. (JO)
+ 
+ 11/17/95 (bug fix) If a window was gridded, Tk still computed the
+ default maximum dimensions in pixel units, which resulted in windows
+ that could grow much larger than the screen. (JO)
+ 
+ 11/17/95 (bug fix) If a menus entries were all disabled, posting
+ the menu and typing Up or Down caused an infinite loop, locking
+ up the screen (JO).
+ 
+ 11/19/95 (bug fix) The focus wasn't being restored properly after a
+ menu selection in a cascaded menu. (JO)
+ 
+ 11/19/95 (bug fix) Menubutton's didn't stipple display their images
+ differently when disabled.  Change to have the same behavior as buttons:
+ the image is stippled over in the background color when the menubutton
+ is disabled. (JO)
+ 
+ 11/21/95 (bug fix) Changes in display attributes such as font could
+ cause core dumps in the text widget under some circumstances involving
+ line wrapping. (JO)
+ 
+ 11/22/95 (bug fix/new feature)  Changed both the placer and the packer
+ to ensure that slaves are unmapped whenever the master is unmapped.
+ This saves time that slaves might otherwise spend trying to redisplay
+ themselves when they're unmapped. (JO)
+ 
+ 11/22/95 (bug fix) Space and return keys didn't work for menus if
+ they were posted via Alt-x keystrokes. (JO)
+ 
+ 11/24/95 (bug fix) tk_dialog procedure had binding for <Return> that
+ always activated default binding, even if input focus was in some
+ other binding.  Removed this feature, since existing focus support
+ will already "do the right thing".  (JO)
+ 
+ 11/24/95 (bug fix) Both canvases and texts could dump core if a binding
+ (such as ButtonRelease on an internal item) deleted the widget. (JO)
+ 
+ 11/24/95 (bug fix) It was possible for a slave to be placed or packed
+ -in itself, with unpleasant consequences.  It is now an error for the
+ slave to be its own master for geometry management. (JO)
+ 
+ 11/25/95 (bug fix) The -command option of scales was sometimes being
+ invoked spuriously (e.g. when the mouse moved in the scale without a
+ button down).  This was because the scale wasn't rounding properly
+ when setting the scale value from its associated variable. (JO)
+ 
+ ----------------- Released patch 4.0p3, 11/28/95 ----------------------
*** ../tk4.0p2/./configure	Mon Sep 18 11:08:13 1995
--- ./configure	Mon Nov 27 09:04:23 1995
***************
*** 401,407 ****
  
  
  
! # @(#) configure.in 1.18 95/09/05 17:04:17
  
  ac_aux_dir=
  for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
--- 401,407 ----
  
  
  
! # @(#) configure.in 1.19 95/10/11 14:13:45
  
  ac_aux_dir=
  for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
***************
*** 1259,1264 ****
--- 1259,1265 ----
          for i in $dirs ; do
  	    if test -r $i/X11/Intrinsic.h; then
  	        XINCLUDES=" -I$i"
+ 		break
  	    fi
          done
      fi
***************
*** 1282,1287 ****
--- 1283,1289 ----
  	for i in $dirs ; do
  	    if test -r $i/libX11.a; then
  		XLIBSW="-L$i -lX11"
+ 		break
  	    fi
  	done
      fi
***************
*** 1300,1306 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lXwindow  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 1304 "configure"
  #include "confdefs.h"
  
  int main() { return 0; }
--- 1302,1308 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lXwindow  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 1306 "configure"
  #include "confdefs.h"
  
  int main() { return 0; }
***************
*** 1358,1364 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lXbsd  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 1362 "configure"
  #include "confdefs.h"
  
  int main() { return 0; }
--- 1360,1366 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lXbsd  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 1364 "configure"
  #include "confdefs.h"
  
  int main() { return 0; }
***************
*** 1391,1397 ****
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1395 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char connect(); below.  */
--- 1393,1399 ----
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1397 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char connect(); below.  */
***************
*** 1439,1445 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lsocket  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 1443 "configure"
  #include "confdefs.h"
  
  int main() { return 0; }
--- 1441,1447 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lsocket  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 1445 "configure"
  #include "confdefs.h"
  
  int main() { return 0; }
***************
*** 1475,1481 ****
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1479 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char accept(); below.  */
--- 1477,1483 ----
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1481 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char accept(); below.  */
***************
*** 1521,1527 ****
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1525 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char gethostbyname(); below.  */
--- 1523,1529 ----
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1527 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char gethostbyname(); below.  */
***************
*** 1565,1571 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lnsl  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 1569 "configure"
  #include "confdefs.h"
  
  int main() { return 0; }
--- 1567,1573 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lnsl  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 1571 "configure"
  #include "confdefs.h"
  
  int main() { return 0; }
***************
*** 1612,1618 ****
      tk_oldLibs=$LIBS
      LIBS="$LIBS -lX11-mit"
      cat > conftest.$ac_ext <<EOF
! #line 1616 "configure"
  #include "confdefs.h"
  
  	#include <X11/Xlib.h>
--- 1614,1620 ----
      tk_oldLibs=$LIBS
      LIBS="$LIBS -lX11-mit"
      cat > conftest.$ac_ext <<EOF
! #line 1618 "configure"
  #include "confdefs.h"
  
  	#include <X11/Xlib.h>
***************
*** 1654,1660 ****
  
  echo $ac_n "checking count field in FILE structures""... $ac_c" 1>&6
  cat > conftest.$ac_ext <<EOF
! #line 1658 "configure"
  #include "confdefs.h"
  #include <stdio.h>
  int main() { return 0; }
--- 1656,1662 ----
  
  echo $ac_n "checking count field in FILE structures""... $ac_c" 1>&6
  cat > conftest.$ac_ext <<EOF
! #line 1660 "configure"
  #include "confdefs.h"
  #include <stdio.h>
  int main() { return 0; }
***************
*** 1670,1676 ****
  
  if test "$fcnt" = ""; then
      cat > conftest.$ac_ext <<EOF
! #line 1674 "configure"
  #include "confdefs.h"
  #include <stdio.h>
  int main() { return 0; }
--- 1672,1678 ----
  
  if test "$fcnt" = ""; then
      cat > conftest.$ac_ext <<EOF
! #line 1676 "configure"
  #include "confdefs.h"
  #include <stdio.h>
  int main() { return 0; }
***************
*** 1687,1693 ****
  fi
  if test "$fcnt" = ""; then
      cat > conftest.$ac_ext <<EOF
! #line 1691 "configure"
  #include "confdefs.h"
  #include <stdio.h>
  int main() { return 0; }
--- 1689,1695 ----
  fi
  if test "$fcnt" = ""; then
      cat > conftest.$ac_ext <<EOF
! #line 1693 "configure"
  #include "confdefs.h"
  #include <stdio.h>
  int main() { return 0; }
***************
*** 1704,1710 ****
  fi
  if test "$fcnt" = ""; then
      cat > conftest.$ac_ext <<EOF
! #line 1708 "configure"
  #include "confdefs.h"
  #include <stdio.h>
  int main() { return 0; }
--- 1706,1712 ----
  fi
  if test "$fcnt" = ""; then
      cat > conftest.$ac_ext <<EOF
! #line 1710 "configure"
  #include "confdefs.h"
  #include <stdio.h>
  int main() { return 0; }
***************
*** 1727,1733 ****
  fi
  if test "$fcnt" = ""; then
      cat > conftest.$ac_ext <<EOF
! #line 1731 "configure"
  #include "confdefs.h"
  #include <stdio.h>
  int main() { return 0; }
--- 1729,1735 ----
  fi
  if test "$fcnt" = ""; then
      cat > conftest.$ac_ext <<EOF
! #line 1733 "configure"
  #include "confdefs.h"
  #include <stdio.h>
  int main() { return 0; }
***************
*** 1754,1760 ****
  fi
  if test "$fcnt" = ""; then
      cat > conftest.$ac_ext <<EOF
! #line 1758 "configure"
  #include "confdefs.h"
  #include <stdio.h>
  int main() { return 0; }
--- 1756,1762 ----
  fi
  if test "$fcnt" = ""; then
      cat > conftest.$ac_ext <<EOF
! #line 1760 "configure"
  #include "confdefs.h"
  #include <stdio.h>
  int main() { return 0; }
***************
*** 1798,1804 ****
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1802 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char sin(); below.  */
--- 1800,1806 ----
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1804 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char sin(); below.  */
***************
*** 1845,1851 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lieee  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 1849 "configure"
  #include "confdefs.h"
  
  int main() { return 0; }
--- 1847,1853 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lieee  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 1851 "configure"
  #include "confdefs.h"
  
  int main() { return 0; }
***************
*** 1883,1889 ****
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1887 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char memmove(); below.  */
--- 1885,1891 ----
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1889 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char memmove(); below.  */
***************
*** 1937,1943 ****
      { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
  else
  cat > conftest.$ac_ext <<EOF
! #line 1941 "configure"
  #include "confdefs.h"
  
  int main()
--- 1939,1945 ----
      { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
  else
  cat > conftest.$ac_ext <<EOF
! #line 1943 "configure"
  #include "confdefs.h"
  
  int main()
***************
*** 1983,1989 ****
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1987 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char BSDgettimeofday(); below.  */
--- 1985,1991 ----
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1989 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char BSDgettimeofday(); below.  */
***************
*** 2027,2033 ****
  
  echo $ac_n "checking for gettimeofday declaration""... $ac_c" 1>&6
  cat > conftest.$ac_ext <<EOF
! #line 2031 "configure"
  #include "confdefs.h"
  #include <sys/time.h>
  EOF
--- 2029,2035 ----
  
  echo $ac_n "checking for gettimeofday declaration""... $ac_c" 1>&6
  cat > conftest.$ac_ext <<EOF
! #line 2033 "configure"
  #include "confdefs.h"
  #include <sys/time.h>
  EOF
***************
*** 2060,2066 ****
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2064 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char strtod(); below.  */
--- 2062,2068 ----
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2066 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char strtod(); below.  */
***************
*** 2106,2112 ****
      { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
  else
  cat > conftest.$ac_ext <<EOF
! #line 2110 "configure"
  #include "confdefs.h"
  
  	extern double strtod();
--- 2108,2114 ----
      { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
  else
  cat > conftest.$ac_ext <<EOF
! #line 2112 "configure"
  #include "confdefs.h"
  
  	extern double strtod();
*** ../tk4.0p2/./configure.in	Tue Sep  5 17:04:17 1995
--- ./configure.in	Wed Oct 11 14:13:44 1995
***************
*** 3,9 ****
  dnl	to configure the system for the local environment.
  AC_INIT(tk.h)
  
! # @(#) configure.in 1.18 95/09/05 17:04:17
  
  AC_PROG_INSTALL
  AC_PROG_RANLIB
--- 3,9 ----
  dnl	to configure the system for the local environment.
  AC_INIT(tk.h)
  
! # @(#) configure.in 1.19 95/10/11 14:13:45
  
  AC_PROG_INSTALL
  AC_PROG_RANLIB
***************
*** 89,94 ****
--- 89,95 ----
          for i in $dirs ; do
  	    if test -r $i/X11/Intrinsic.h; then
  	        XINCLUDES=" -I$i"
+ 		break
  	    fi
          done
      fi
***************
*** 112,117 ****
--- 113,119 ----
  	for i in $dirs ; do
  	    if test -r $i/libX11.a; then
  		XLIBSW="-L$i -lX11"
+ 		break
  	    fi
  	done
      fi
*** ../tk4.0p2/./library/dialog.tcl	Fri Jul 28 09:35:56 1995
--- ./library/dialog.tcl	Fri Nov 24 15:03:00 1995
***************
*** 3,9 ****
  # This file defines the procedure tk_dialog, which creates a dialog
  # box containing a bitmap, a message, and one or more buttons.
  #
! # @(#) dialog.tcl 1.16 95/07/28 09:35:57
  #
  # Copyright (c) 1992-1993 The Regents of the University of California.
  # Copyright (c) 1994-1995 Sun Microsystems, Inc.
--- 3,9 ----
  # This file defines the procedure tk_dialog, which creates a dialog
  # box containing a bitmap, a message, and one or more buttons.
  #
! # @(#) dialog.tcl 1.18 95/11/24 15:03:04
  #
  # Copyright (c) 1992-1993 The Regents of the University of California.
  # Copyright (c) 1994-1995 Sun Microsystems, Inc.
***************
*** 45,53 ****
      frame $w.bot -relief raised -bd 1
      pack $w.bot -side bottom -fill both
  
!     # 2. Fill the top part with bitmap and message.
  
!     label $w.msg -wraplength 3i -justify left -text $text \
  	    -font -Adobe-Times-Medium-R-Normal--*-180-*-*-*-*-*-*
      pack $w.msg -in $w.top -side right -expand 1 -fill both -padx 3m -pady 3m
      if {$bitmap != ""} {
--- 45,56 ----
      frame $w.bot -relief raised -bd 1
      pack $w.bot -side bottom -fill both
  
!     # 2. Fill the top part with bitmap and message (use the option
!     # database for -wraplength so that it can be overridden by
!     # the caller).
  
!     option add *Dialog.msg.wrapLength 3i widgetDefault
!     label $w.msg -justify left -text $text \
  	    -font -Adobe-Times-Medium-R-Normal--*-180-*-*-*-*-*-*
      pack $w.msg -in $w.top -side right -expand 1 -fill both -padx 3m -pady 3m
      if {$bitmap != ""} {
***************
*** 65,71 ****
  	    raise $w.button$i $w.default
  	    pack $w.default -in $w.bot -side left -expand 1 -padx 3m -pady 2m
  	    pack $w.button$i -in $w.default -padx 2m -pady 2m
- 	    bind $w <Return> "$w.button$i flash; set tkPriv(button) $i"
  	} else {
  	    pack $w.button$i -in $w.bot -side left -expand 1 \
  		    -padx 3m -pady 2m
--- 68,73 ----
*** ../tk4.0p2/./library/focus.tcl	Thu Jun  8 13:18:30 1995
--- ./library/focus.tcl	Mon Oct 30 08:08:24 1995
***************
*** 3,9 ****
  # This file defines several procedures for managing the input
  # focus.
  #
! # @(#) focus.tcl 1.14 95/05/04 13:31:48
  #
  # Copyright (c) 1994-1995 Sun Microsystems, Inc.
  #
--- 3,9 ----
  # This file defines several procedures for managing the input
  # focus.
  #
! # @(#) focus.tcl 1.15 95/10/30 08:08:27
  #
  # Copyright (c) 1994-1995 Sun Microsystems, Inc.
  #
***************
*** 167,173 ****
      set script {
  	if {("%d" == "NotifyAncestor") || ("%d" == "NotifyNonlinear")
  		|| ("%d" == "NotifyInferior")} {
! 	    focus %W
  	}
      }
      if {$old != ""} {
--- 167,175 ----
      set script {
  	if {("%d" == "NotifyAncestor") || ("%d" == "NotifyNonlinear")
  		|| ("%d" == "NotifyInferior")} {
! 	    if [tkFocusOK %W] {
! 		focus %W
! 	    }
  	}
      }
      if {$old != ""} {
*** ../tk4.0p2/./library/listbox.tcl	Tue Aug 22 08:49:49 1995
--- ./library/listbox.tcl	Thu Nov  2 11:02:17 1995
***************
*** 3,9 ****
  # This file defines the default bindings for Tk listbox widgets
  # and provides procedures that help in implementing those bindings.
  #
! # @(#) listbox.tcl 1.13 95/08/22 08:49:50
  #
  # Copyright (c) 1994 The Regents of the University of California.
  # Copyright (c) 1994-1995 Sun Microsystems, Inc.
--- 3,9 ----
  # This file defines the default bindings for Tk listbox widgets
  # and provides procedures that help in implementing those bindings.
  #
! # @(#) listbox.tcl 1.14 95/11/02 11:02:19
  #
  # Copyright (c) 1994 The Regents of the University of California.
  # Copyright (c) 1994-1995 Sun Microsystems, Inc.
***************
*** 37,42 ****
--- 37,51 ----
  	tkListboxBeginSelect %W [%W index @%x,%y]
      }
  }
+ 
+ # Ignore double clicks so that users can define their own behaviors.
+ # Among other things, this prevents errors if the user deletes the
+ # listbox on a double click.
+ 
+ bind Listbox <2> {
+     # Empty script
+ }
+ 
  bind Listbox <B1-Motion> {
      set tkPriv(x) %x
      set tkPriv(y) %y
*** ../tk4.0p2/./library/menu.tcl	Tue Aug 29 17:33:54 1995
--- ./library/menu.tcl	Fri Nov 24 14:51:33 1995
***************
*** 4,10 ****
  # It also implements keyboard traversal of menus and implements a few
  # other utility procedures related to menus.
  #
! # @(#) menu.tcl 1.54 95/08/29 17:33:53
  #
  # Copyright (c) 1992-1994 The Regents of the University of California.
  # Copyright (c) 1994-1995 Sun Microsystems, Inc.
--- 4,10 ----
  # It also implements keyboard traversal of menus and implements a few
  # other utility procedures related to menus.
  #
! # @(#) menu.tcl 1.59 95/11/24 14:51:37
  #
  # Copyright (c) 1992-1994 The Regents of the University of California.
  # Copyright (c) 1994-1995 Sun Microsystems, Inc.
***************
*** 102,112 ****
  
  # Must set focus when mouse enters a menu, in order to allow
  # mixed-mode processing using both the mouse and the keyboard.
  
  bind Menu <FocusIn> {}
  bind Menu <Enter> {
      set tkPriv(window) %W
!     focus %W
  }
  bind Menu <Leave> {
      tkMenuLeave %W %X %Y %s
--- 102,118 ----
  
  # Must set focus when mouse enters a menu, in order to allow
  # mixed-mode processing using both the mouse and the keyboard.
+ # Don't set the focus if the event comes from a grab release,
+ # though:  such an event can happen after as part of unposting
+ # a cascaded chain of menus, after the focus has already been
+ # restored to wherever it was before menu selection started.
  
  bind Menu <FocusIn> {}
  bind Menu <Enter> {
      set tkPriv(window) %W
!     if {"%m" != "NotifyUngrab"} {
! 	focus %W
!     }
  }
  bind Menu <Leave> {
      tkMenuLeave %W %X %Y %s
***************
*** 118,130 ****
      tkMenuButtonDown %W
  }
  bind Menu <ButtonRelease> {
!     tkMenuInvoke %W
  }
  bind Menu <space> {
!     tkMenuInvoke %W
  }
  bind Menu <Return> {
!     tkMenuInvoke %W
  }
  bind Menu <Escape> {
      tkMenuEscape %W
--- 124,136 ----
      tkMenuButtonDown %W
  }
  bind Menu <ButtonRelease> {
!     tkMenuInvoke %W 1
  }
  bind Menu <space> {
!     tkMenuInvoke %W 0
  }
  bind Menu <Return> {
!     tkMenuInvoke %W 0
  }
  bind Menu <Escape> {
      tkMenuEscape %W
***************
*** 479,486 ****
  #
  # Arguments:
  # w -			Name of the menu widget.
  
! proc tkMenuInvoke w {
      if {[$w type active] == "cascade"} {
  	$w postcascade active
  	set menu [$w entrycget active -menu]
--- 485,506 ----
  #
  # Arguments:
  # w -			Name of the menu widget.
+ # buttonRelease -	1 means this procedure is called because of
+ #			a button release;  0 means because of keystroke.
  
! proc tkMenuInvoke {w buttonRelease} {
!     global tkPriv
! 
!     if {$buttonRelease && ($tkPriv(window) == "")} {
! 	# Mouse was pressed over a menu without a menu button, then
! 	# dragged off the menu (possibly with a cascade posted) and
! 	# released.  Unpost everything and quit.
! 
! 	$w postcascade none
! 	$w activate none
! 	tkMenuUnpost $w
! 	return
!     }
      if {[$w type active] == "cascade"} {
  	$w postcascade active
  	set menu [$w entrycget active -menu]
***************
*** 599,604 ****
--- 619,625 ----
  	return
      }
      set length [expr [$menu index last]+1]
+     set quitAfter $length
      set active [$menu index active]
      if {$active == "none"} {
  	set i 0
***************
*** 606,611 ****
--- 627,638 ----
  	set i [expr $active + $count]
      }
      while 1 {
+ 	if {$quitAfter <= 0} {
+ 	    # We've tried every entry in the menu.  Either there are
+ 	    # none, or they're all disabled.  Just give up.
+ 
+ 	    return
+ 	}
  	while {$i < 0} {
  	    incr i $length
  	}
***************
*** 621,626 ****
--- 648,654 ----
  	    return
  	}
  	incr i $count
+ 	incr quitAfter -1
      }
      $menu activate $i
      $menu postcascade $i
*** ../tk4.0p2/./library/prolog.ps	Thu Jun  8 13:18:31 1995
--- ./library/prolog.ps	Thu Nov  9 11:35:02 1995
***************
*** 3,9 ****
  
  % This is a standard prolog for Postscript generated by Tk's canvas
  % widget.
! % @(#) prolog.ps 1.2 94/12/09 10:53:18
  
  % The definitions below just define all of the variables used in
  % any of the procedures here.  This is needed for obscure reasons
--- 3,9 ----
  
  % This is a standard prolog for Postscript generated by Tk's canvas
  % widget.
! % @(#) prolog.ps 1.3 95/11/09 11:35:04
  
  % The definitions below just define all of the variables used in
  % any of the procedures here.  This is needed for obscure reasons
***************
*** 71,82 ****
      ] def
  } if
  
! % Override the setfont procedure with a new procedure that re-encodes
! % the font to use the ISO Latin-1 style.  The body of this procedure
! % comes from Section 5.6.1 of the Postscript book.
  
! /realsetfont /setfont load def
! /setfont {
      dup length dict begin
  	{1 index /FID ne {def} {pop pop} ifelse} forall
  	/Encoding ISOLatin1Encoding def
--- 71,83 ----
      ] def
  } if
  
! % font ISOEncode font
! % This procedure changes the encoding of a font from the default
! % Postscript encoding to ISOLatin1.  It's typically invoked just
! % before invoking "setfont".  The body of this procedure comes from
! % Section 5.6.1 of the Postscript book.
  
! /ISOEncode {
      dup length dict begin
  	{1 index /FID ne {def} {pop pop} ifelse} forall
  	/Encoding ISOLatin1Encoding def
***************
*** 88,94 ****
      % for the font.
  
      /Temporary exch definefont
-     realsetfont
  } bind def
  
  % StrokeClip
--- 89,94 ----
*** ../tk4.0p2/./doc/canvas.n	Wed Jun 28 16:29:59 1995
--- ./doc/canvas.n	Sat Oct 28 14:36:07 1995
***************
*** 5,11 ****
  '\" See the file "license.terms" for information on usage and redistribution
  '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  '\" 
! '\" @(#) canvas.n 1.39 95/06/28 16:29:58
  '\"
  .so man.macros
  .TH canvas n 4.0 Tk "Tk Built-In Commands"
--- 5,11 ----
  '\" See the file "license.terms" for information on usage and redistribution
  '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  '\" 
! '\" @(#) canvas.n 1.40 95/10/28 14:36:10
  '\"
  .so man.macros
  .TH canvas n 4.0 Tk "Tk Built-In Commands"
***************
*** 709,715 ****
  or \fBp\fR or nothing for printer's points (1/72 inch).
  Defaults to the height of the printed area on the screen.
  If both \fB\-pageheight\fR and \fB\-pagewidth\fR are specified then
! the scale factor from the later option is used (non-uniform scaling
  is not implemented).
  .TP
  \fB\-pagewidth \fIsize\fR
--- 709,715 ----
  or \fBp\fR or nothing for printer's points (1/72 inch).
  Defaults to the height of the printed area on the screen.
  If both \fB\-pageheight\fR and \fB\-pagewidth\fR are specified then
! the scale factor from \fB\-pagewidth\fR is used (non-uniform scaling
  is not implemented).
  .TP
  \fB\-pagewidth \fIsize\fR
***************
*** 718,724 ****
  \fISize\fR has the same form as for \fB\-pageheight\fR.
  Defaults to the width of the printed area on the screen.
  If both \fB\-pageheight\fR and \fB\-pagewidth\fR are specified then
! the scale factor from the later option is used (non-uniform scaling
  is not implemented).
  .TP
  \fB\-pagex \fIposition\fR
--- 718,724 ----
  \fISize\fR has the same form as for \fB\-pageheight\fR.
  Defaults to the width of the printed area on the screen.
  If both \fB\-pageheight\fR and \fB\-pagewidth\fR are specified then
! the scale factor from \fB\-pagewidth\fR  is used (non-uniform scaling
  is not implemented).
  .TP
  \fB\-pagex \fIposition\fR
*** ../tk4.0p2/./doc/wish.1	Wed Jun  7 21:15:51 1995
--- ./doc/wish.1	Mon Sep 25 14:38:11 1995
***************
*** 1,11 ****
  '\"
  '\" Copyright (c) 1991-1994 The Regents of the University of California.
! '\" Copyright (c) 1994 Sun Microsystems, Inc.
  '\"
  '\" See the file "license.terms" for information on usage and redistribution
  '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  '\" 
! '\" @(#) wish.1 1.19 95/06/07 21:15:41
  '\" 
  .so man.macros
  .TH wish 1 4.0 Tk "Tk Applications"
--- 1,11 ----
  '\"
  '\" Copyright (c) 1991-1994 The Regents of the University of California.
! '\" Copyright (c) 1994-1995 Sun Microsystems, Inc.
  '\"
  '\" See the file "license.terms" for information on usage and redistribution
  '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  '\" 
! '\" @(#) wish.1 1.20 95/09/25 14:38:12
  '\" 
  .so man.macros
  .TH wish 1 4.0 Tk "Tk Applications"
***************
*** 29,34 ****
--- 29,39 ----
  Execute all X server commands synchronously, so that errors
  are reported immediately.  This will result in much slower
  execution, but it is useful for debugging.
+ .IP "\fB\-\|\-\fR" 20
+ Pass all remaining arguments through to the script's \fBargv\fR
+ variable without interpreting them.
+ This provides a mechanism for passing arguments such as \fB\-name\fR
+ to a script instead of having \fBwish\fR interpret them.
  .BE
  
  .SH DESCRIPTION
***************
*** 91,99 ****
  not including the options described above.
  .TP 15
  \fBargv\fR
! Contains a Tcl list whose elements are the \fIarg\fR arguments (not
! including the options described above), in order, or an empty string
! if there are no \fIarg\fR arguments.
  .TP 15
  \fBargv0\fR
  Contains \fIfileName\fR if it was specified.
--- 96,105 ----
  not including the options described above.
  .TP 15
  \fBargv\fR
! Contains a Tcl list whose elements are the \fIarg\fR arguments
! that follow a \fB\-\|\-\fR option or don't match any of the
! options described in OPTIONS above, in order, or an empty string
! if there are no such arguments.
  .TP 15
  \fBargv0\fR
  Contains \fIfileName\fR if it was specified.
*** ../tk4.0p2/./tests/geometry.test	Tue Feb 21 16:36:58 1995
--- ./tests/geometry.test	Mon Nov 27 13:19:36 1995
***************
*** 8,14 ****
  # See the file "license.terms" for information on usage and redistribution
  # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  #
! # @(#) geometry.test 1.5 95/02/21 16:36:58
  
  if {[info procs test] != "test"} {
      source defs
--- 8,14 ----
  # See the file "license.terms" for information on usage and redistribution
  # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  #
! # @(#) geometry.test 1.6 95/11/27 13:19:40
  
  if {[info procs test] != "test"} {
      source defs
***************
*** 244,249 ****
--- 244,250 ----
      after 500 {set x 1}
      tkwait variable x
      wm deiconify .t
+     update
      winfo ismapped .t.quit
  } {1}
  catch {destroy .t}
*** ../tk4.0p2/./tests/textDisp.test	Wed Jun 28 14:52:05 1995
--- ./tests/textDisp.test	Mon Nov 27 13:22:03 1995
***************
*** 7,13 ****
  # See the file "license.terms" for information on usage and redistribution
  # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  #
! # @(#) textDisp.test 1.31 95/06/28 14:52:03
  
  if {[string compare test [info procs test]] == 1} then \
    {source defs}
--- 7,13 ----
  # See the file "license.terms" for information on usage and redistribution
  # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  #
! # @(#) textDisp.test 1.32 95/11/27 13:22:07
  
  if {[string compare test [info procs test]] == 1} then \
    {source defs}
***************
*** 1410,1416 ****
      .t insert end "xxxx xxxxxxxxx xxxxxxxxxxxxx"
      .t xview moveto .3
      .t xview
! } {0.285714 0.642857}
  test textDisp-14.8 {TkTextXviewCmd procedure} {
      .t delete 1.0 end
      .t insert end xxxxxxxxx\n
--- 1410,1416 ----
      .t insert end "xxxx xxxxxxxxx xxxxxxxxxxxxx"
      .t xview moveto .3
      .t xview
! } {0.303571 0.660714}
  test textDisp-14.8 {TkTextXviewCmd procedure} {
      .t delete 1.0 end
      .t insert end xxxxxxxxx\n
